<!DOCTYPE html>
<html>
<head lang="en">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <meta charset="UTF-8">
    <title></title>
    <style>

        .a1 {
            width: 300px;
            margin: auto;
            background-color: dodgerblue;
        }
        .a1 > li {
            display: inline;
        }
        .a2 {
            max-width: 300px;
            margin: auto;
            background-color: chartreuse;
        }
        .a2 > li {
            display: block;
        }

        .a3 > li {
            display: inline-block;
        }

        .a4 > li {
            display: none;
        }
    </style>
</head>
<body>

<ul class="a1">
    <li>a</li>
    <li>a</li>
    <li>a</li>
    <li>a</li>
</ul>

<ul class="a2">
    <li>a</li>
    <li>a</li>
    <li>a</li>
    <li>a</li>
</ul>

<ul class="a3">
    <li>a</li>
    <li>a</li>
    <li>a</li>
    <li>a</li>
</ul>

<ul class="a4">
    <li>a</li>
    <li>a</li>
    <li>a</li>
    <li>a</li>
</ul>
</body>
</html>